﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Panel.Master" Inherits="System.Web.Mvc.ViewPage<IList<Prodma.DataAccess.Models.ViewModels.LanguageVm>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=System.Configuration.ConfigurationManager.AppSettings["pageTitle"] %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="listHeader">
        <img src="../../Images/ListImages/languagelist.png" alt="" class="listHeaderIco" />
        <div class="listHeaderText">Dil Yöneticisi</div>
        
        <div class="listHeaderMenuBox">
            <% Html.RenderPartial("/views/shared/userControls/navigation.ascx",
                   Prodma.DataAccess.Authorization.Authorization.GetNavigation("language", 5));%>
        </div>
    </div>
    
    <div class="listFindBar">
        <% Html.RenderPartial("/views/shared/userControls/find.ascx",
               new Prodma.DataAccess.Models.UserControlViewModels.FindVm() { View = "language" });%>
    </div>
    
    <div class="listTitleContainer">
        <div class="listTitleCenter-50">#</div>
        <div class="listTitleCenter-50"><input type="checkbox" id="chk" name="chk" /></div>
        <div class="listTitleLeft-200">Ad</div>
        <div class="listTitleCenter-150">Durum</div>
        <div class="listTitleCenter-50">ID</div>
    </div>
    
    <div class="listRowContainer">
        <% int counter = 1; %>
        <% foreach (Prodma.DataAccess.Models.ViewModels.LanguageVm language in ViewData.Model) %>
        <% { %>
             <% if (counter % 2 != 0) %>
             <% { %>
                  <div class="listRow1">
                      <div class="listColumnCenter-50"><%=counter %></div>                      
                      <div class="listColumnCenter-50"><input type="checkbox" id='chk<%=language.Id %>' name="chkSelect" /></div>
                      <div class="listColumnLeft-200">
                        <a href='/language/edit/?id=<%=language.Id %>' class="listSelectItemBold">
                            <%=language.Name%>
                        </a>
                      </div>
                      <div class="listColumnCenter-150"><%=language.State.Name%></div>
                      <div class="listColumnCenter-50"><%=language.Id%></div>
                  </div>
             <% } %>
             <% else %>
             <% { %>
                  <div class="listRow2">
                      <div class="listColumnCenter-50"><%=counter %></div>                      
                      <div class="listColumnCenter-50"><input type="checkbox" id='chk<%=language.Id %>' name="chkSelect" /></div>
                      <div class="listColumnLeft-200">
                        <a href='/language/edit/?id=<%=language.Id %>' class="listSelectItemBold">
                            <%=language.Name%>
                        </a>
                      </div>
                      <div class="listColumnCenter-150"><%=language.State.Name%></div>
                      <div class="listColumnCenter-50"><%=language.Id%></div>
                  </div>
             <% } %>
             <% counter++; %>
        <% } %>
    </div>

    <script type="text/javascript">
        $(function() {
            $('#chk').click(function() {
                $("input[type='checkbox']").attr('checked', $('#chk').is(':checked'));
            });
        });
    </script>

</asp:Content>
